<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListAccount.ascx.cs" Inherits="TVT.UI.UserControls.ListAccount" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:UpdatePanel ID="UPnlListAccount" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <table style="text-align:left" width="100%" cellpadding="0" cellspacing="0" >
            <tr>
                <td class="style2" style="background-image:url(App_Themes/NewDesign/Images/barra-pix.gif);">
                    <img id="imgPoints" src="App_Themes/NewDesign/Images/tild-tit.gif" style="vertical-align:middle"/>
                    <font class="titleText">Accounts</font>
                </td>
                <td class="style2" align="right"  style="background-image:url(App_Themes/NewDesign/Images/barra-pix.gif);">    
                    <asp:LinkButton ID="lnkBtnCollapseExpand" runat="server"><asp:Image ID="imgCollapseExpand" ImageUrl="~/App_Themes/NewDesign/Images/_icon.gif" runat="server" style="padding-right:10px;vertical-align:middle;" /></asp:LinkButton>
                </td>
            </tr>
        </table>
        <asp:Panel CssClass="contentMargins" ID="pnlSearchAccountResults" runat="server" Width="95%" style="text-align:left;">
        <table style="text-align:left;" cellpadding="0px" cellspacing="0px" width="1010px">
                <tr>
                    <td align="left">
                        <asp:Label ID="lblAccountSearchResultMessage" runat="server" Visible="false" CssClass="transactionResultMessage"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="left">       
                        <asp:Panel  id="pnlSearchResultContainer" runat="server" Visible="true">                                                
                        <asp:GridView BorderStyle="none" ShowFooter="true" ShowHeader="true" ID="gvAccount" runat="server" autogeneratecolumns="False" 
                            OnSorting="OnSortingGridViewAccount" DataKeyNames="Id" style="text-align:center" Width="600px" OnPageIndexChanging="gvAccount_PageIndexChanging" OnRowCommand="gvAccount_RowCommand" OnRowDataBound="gvAccount_RowDataBound" allowpaging="True" allowsorting="True">                         
                            <HeaderStyle CssClass="headerTable" ForeColor="white" BorderWidth="0px"/>                                                                                
                              <columns>
                                <asp:boundfield  datafield="Id" sortexpression="Id" Visible="False" />
                                <asp:TemplateField HeaderStyle-CssClass="gridHeader" SortExpression="Name" HeaderStyle-HorizontalAlign="left"  HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#5a99e0"   HeaderText="Account Number" ItemStyle-BorderWidth="0px" FooterStyle-BorderWidth="0px" ItemStyle-Height="20px">
                                    <ItemTemplate >                                      
                                        <table width="200px" cellpadding="0px" cellspacing="0px" style="height:35px">
                                          <tr>
                                           <td class="cellStyle" style="padding-left:20px;text-align:left" >
                                                <asp:Label runat="server" id="lblAccountName"/>                                        
                                            </td>
                                         </tr>
                                       </table> 
                                    </ItemTemplate>                                    
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-CssClass="gridHeader" SortExpression="Interest" HeaderStyle-HorizontalAlign="left"  HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#5a99e0"   HeaderText="Interest" ItemStyle-BorderWidth="0px" FooterStyle-BorderWidth="0px" ItemStyle-Height="20px">
                                    <ItemTemplate >                                      
                                        <table width="200px" cellpadding="0px" cellspacing="0px" style="height:35px">
                                          <tr>
                                            <td class="cellStyle" style="padding-left:20px;text-align:left" >
                                                <asp:Label runat="server" id="lblAccountInterest"/>                                        
                                            </td>
                                         </tr>
                                       </table> 
                                    </ItemTemplate>                                    
                                </asp:TemplateField>     
                                <asp:TemplateField HeaderStyle-CssClass="gridHeader" SortExpression="Name" HeaderStyle-HorizontalAlign="left"  HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#5a99e0"   HeaderText="Company" ItemStyle-BorderWidth="0px" FooterStyle-BorderWidth="0px" ItemStyle-Height="20px">
                                    <ItemTemplate >                                      
                                        <table width="200px" cellpadding="0px" cellspacing="0px" style="height:35px">
                                          <tr>
                                           <td class="cellStyle" style="padding-left:20px;text-align:left" >
                                                <asp:Label runat="server" id="lblCompany"/>                                        
                                            </td>
                                         </tr>
                                       </table> 
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-CssClass="gridHeader" SortExpression="ClearingName" HeaderStyle-HorizontalAlign="left"  HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#5a99e0"   HeaderText="Clearing" ItemStyle-BorderWidth="0px" FooterStyle-BorderWidth="0px" ItemStyle-Height="20px">
                                    <ItemTemplate>
                                        <table width="200px" cellpadding="0px" cellspacing="0px" style="height:35px">
                                          <tr>
                                            <td class="cellStyle" style="padding-left:20px;text-align:left">
                                                <asp:Label runat="server" id="lblClearing"/>
                                            </td>
                                         </tr>
                                       </table> 
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#5a99e0" HeaderText="Options" HeaderStyle-Width="120px" ItemStyle-BorderWidth="0px" FooterStyle-BorderWidth="0px" HeaderStyle-CssClass="gridHeader">
                                    <ItemTemplate >                                      
                                        <table style="height:35px" width="120px" cellpadding="0px" cellspacing="0px" >
                                          <tr>                                           
                                            <td class="cellStyle" style="width:60px;text-align:center" >
                                                <asp:ImageButton ImageUrl="~/App_Themes/NewDesign/Images/Edit-icon.gif" ID="lbtnEdit" runat="server" Text="Edit" CommandName="EditAccount" style="vertical-align:middle"/>                                        
                                            </td>
                                            <td style="width:2px">
                                               <%--ItemSeparator--%>
                                            </td>
                                            <td class="cellStyle" style="width:60px;text-align:center">
                                                <asp:ImageButton ImageUrl="~/App_Themes/NewDesign/Images/delete-icon.gif" ID="lbtnDelete" runat="server" Text="Delete" CommandName="DeleteAccount" style="vertical-align:middle"></asp:ImageButton>
                                                <ajaxToolkit:ConfirmButtonExtender ID="cbe" runat="server" TargetControlID="lbtnDelete" ConfirmText="Are you sure you want to delete this Account?"/>
                                            </td>
                                         </tr>
                                       </table> 
                                    </ItemTemplate>
                                    
                                    <FooterTemplate>
                                        <table cellpadding="0px" cellspacing="0px" style="height:25px;">
                                            <tr>
                                                <td style="width:61px;" class="OptionStyle">
                                                    <asp:Label id="lblEdit" runat="server"  Text="Edit" CssClass="OptionText"></asp:Label>
                                                </td>
                                                <td style="width:2px">
                                                     <%--ItemSeparator--%>
                                                 </td>
                                                <td style="width:59px;" class="OptionStyle">
                                                    <asp:Label id="lblDelete" runat="server" Text="Delete" CssClass="OptionText"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </FooterTemplate>
                                </asp:TemplateField>                                
                           </columns>                           
                        </asp:GridView>
                    </asp:Panel>
                </td>
             </tr>
         </table>
</asp:Panel>      
<ajaxToolkit:CollapsiblePanelExtender ID="SearchAccountPanelExtender" runat="server"
            TargetControlID="pnlSearchAccountResults"
            CollapsedSize="0"
            Collapsed="False"
            ExpandControlID="lnkBtnCollapseExpand"
            CollapseControlID="lnkBtnCollapseExpand"
            AutoCollapse="False"
            AutoExpand="False"
            ImageControlID="imgCollapseExpand"
            ExpandedImage="~/App_Themes/NewDesign/Images/_icon.gif"
            CollapsedImage="~/App_Themes/NewDesign/Images/+icon.gif"
            ExpandDirection="Vertical" />                
    </ContentTemplate>
</asp:UpdatePanel>